Chris Pollett >Old Classes >
CS151

( Print View )

Student Corner:
  [Grades Sec5]

  [Submit Sec5]

  [Email List Sec5]

  [
Lecture Notes]

Course Info:
  [Texts & Links]
  [Topics]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












HW#2 --- last modified March 02 2019 21:22:28..

Solution set.

Due date: Oct 10

Files to be submitted:
  Diagrams.pdf
  Calendar.zip
  Calendar.html

Purpose: To gain experience with sequence, UML, and use case diagram. To create a project using by using a simple requirement gathering, design, implement process. To learn to use ant. To gain experience with Java GUI programming, File I/O, and inheritance.

Specification:

For this homework you will develop a simple calendar program in Java. This program should run both as a Java application and as an applet. When it is built it should live in a jar file called Calendar.jar along with the auxiliary files Preferences.txt and ScheduledEvents.txt. To begin you will gather what you think are good requirements for such an application. You might look at existing applications such as Yahoo Calendar, Outlook, iCal, Evolution, Palm Date Book, etc. At a minimum your calendar needs to be able to: (a) Figure out what day it currently is and use this in determining what it displays. (If no other date was listed in the preference file.) (b) Be able to retrieve previously scheduled events for any day in the past or future, these events being read from the file ScheduledDates.txt in Calendar.jar. (c) Your program should also read from Preferences.txt information about what day should be displayed, what view of the Scheduled events should be shown, and what font size should be used to display information. The view of the scheduled events can be either a single day's events which are stored in the calendar, a whole week's events, or a whole month's events. Views should leverage off a common base class or interface. (d) Rendering of the displayed data should be done by overriding paint. (e) Besides drawing text you must also draw your calendar graphically using the commands using at least three of the functions listed on pages 198-199 of the text. Note: I am not asking you to write a program that can store new events or change what day is viewed or the scene viewed after your program is run. I am only asking you to draw based on what the Preferences.txt file says together with what is stored in ScheduledEvents.txt.

I want you to use CRC cards to develop some classes and hierarchies for your calendar. You can work in teams of up to three people for this part of the assignment. Each person though turns in a separate copy of this part of the assignment in their Diagrams.pdf file. This is the only part of the assignment I want you to work in teams. You should then also develop use case diagrams for this calendar program, and then finally a UML diagram. Your project should be in its own unique package and you should illustrate this in the UML diagram. These other diagrams should also be put in your Diagrams.pdf file. Finally, you should make a sequence diagram also in Diagrams.pdf which illustrates how your program gets launched when it is run as an applet.

Once you are done designing your calendar, I want you to implement it. All of your project java files should be stored in the file Calendar.zip. This file should also contain a build.xml to build your project using ant. The build.xml file should be created by hand. It should support the targets: clean; build_1, build_2, ...; and run_1, run_2, ... clean should delete all class and jar files generated by ant. build_i (where i is 1,2,...) should make use of the files Preferences_i.txt and ScheduledEvents_i.txt. It should copy them to the files Preferences.txt and ScheduledEvents.txt respectively. It should then compile your source code, and then put the resulting class files, Preferences.txt, and ScheduledEvents.txt into Calendar.jar. The targets run_i (i=1,2,...) should depend on build_i and then execute your program as an application. The point of having all the different Preference_i.txt and SheduledEvents_i.txt files is that each of these files should demonstrate different aspects of how your application reads from the files Preferences.txt and ScheduledEvents.txt and uses this information to change what it displays. You should include in Calendar.zip a file ReadMe.txt explaining what things run_1, run_2, run_3, etc, show about your program. A last thing that should be in your Calendar.zip is a file Calendar.html which can be used to test your calendar run as an applet.

Point Breakdown

Departmental coding guidelines for Java followed. 1pt
Your sequence diagrams, UML diagrams, use cases, and CRC cards are as described above. (1/2 point each) 2pts
build.xml and Calendar.html are as describe (1/2pt each). 1pt
Points (a)-(e) listed above (1pt each). 6pts
Total10pts